<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib uri="http://displaytag.sf.net" prefix="display"%>
<%@taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%>

<!-- becomes the css class of the li element -->
<c:set var="tab_employees" value="active" scope="request"/>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Employees</title>

<script type="text/javascript">
</script>

</head>

<body>

	<sec:authorize ifAnyGranted="ROLE_ADMIN">
		<a href="<c:url value='empledit.htm'/>">Add Employee</a>
	</sec:authorize>
	
	<display:table uid="employee" name="${employees}" defaultsort="1"
		defaultorder="ascending" pagesize="10" class="dt">
		<display:column property="sirName" sortable="true" title="Sir Name"	maxLength="60" />
		<display:column property="firstName" sortable="true" title="First Name" maxLength="60" />
		<display:column property="phoneNumber" sortable="false" title="Phone Number" maxLength="15" />
		<display:column property="address" sortable="false" title="Address" maxLength="100" />
		<display:column property="hireDate" sortable="false" title="Hire Date"	maxLength="10" />
		<display:column property="qualification" sortable="false" title="Qualification"	maxLength="50" />
		<display:column property="function" sortable="false" title="Current Function" maxLength="50" />
		<display:column property="salary" sortable="false" title="Salary" maxLength="10"/>
		<display:column sortable="false" title="Ship" value="${employee.ship.name}"/>
		
		<display:column>
			<sec:authorize ifAnyGranted="ROLE_ADMIN">
			<a href="<c:url value='empledit.htm?employeeId=${employee.id}'/>"><img src="<c:url value='images/edit.png'/>"/></a>
			</sec:authorize>
		</display:column>

		<display:setProperty name="basic.empty.showtable" value="true" />
		<display:setProperty name="paging.banner.group_size" value="10" />
		<display:setProperty name="paging.banner.item_name" value="ship" />
		<display:setProperty name="paging.banner.item_names" value="ships" />
		<display:setProperty name="paging.banner.onepage"
			value="<span class='pagelinks'>&nbsp;</span>" />
	</display:table>
	
</body>
</html>
